/**
 * 
 */
package cc.rico.sync;

import org.junit.Test;

import cc.rico.api.BaseZK;

/**
 * @author rico 2016年8月20日
 *
 */
public class SyncTest extends BaseZK {
	
	@Test
	public void testSync() {
		try {
			ZkSync sync = new ZkSync();
			sync.syncData("init data...");
			
			ZkReceiver zk1 = new ZkReceiver("127.0.0.1:2182");
			ZkReceiver zk2 = new ZkReceiver("127.0.0.1:2183");
			
			sync.syncData("init data 11...");
			sync.syncData("init data 22...");
			sync.syncData("init data 33...");
			sync.syncData("init data 44...");
			
			zk1.close();
			zk2.close();
			sync.close();
			
			Thread.sleep(5000);
			
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
}
